package com.remote
{
	import mx.collections.ArrayCollection;
	import mx.rpc.AsyncToken;
	import mx.rpc.IResponder;
	import mx.rpc.remoting.RemoteObject;

	public class ReportService
	{
		private var ro:RemoteObject;
		public function ReportService()
		{
			ro = new mx.rpc.remoting.RemoteObject("reportting");
			ro.source = "report.ReportService";
		}
		
		public function insert_Report(rtpName:String, rtpStatus:String, rptFileName:String, rptStoreName:String,
									  rptExport:String, userAction:String, arrResult:ArrayCollection,
									  responder:IResponder = null ):void
		{
			var asyncToken:AsyncToken = ro.insert_Report(rtpName, rtpStatus, rptFileName, rptStoreName,
										rptExport, userAction, arrResult);
			if( responder != null )
				asyncToken.addResponder(responder);
		}
		
		public function update_Report(rptId:String,rtpName:String, rtpStatus:String, rptFileName:String, rptStoreName:String,
									  rptExport:String, userAction:String, arrResult:ArrayCollection,
									  responder:IResponder = null ):void
		{
			var asyncToken:AsyncToken = ro.update_Report(rptId,rtpName, rtpStatus, rptFileName, rptStoreName,
				rptExport, userAction, arrResult);
			if( responder != null )
				asyncToken.addResponder(responder);
		}
		
		public function delete_Report(rptID:String, userAction:String, responder:IResponder = null ):void
		{
			var asyncToken:AsyncToken  = ro.delete_Report(rptID, userAction);
			if( responder != null )
				asyncToken.addResponder(responder);	    
		}
		
		public function getReportList(rtpName:String, responder:IResponder = null):void
		{
			var asyncToken:AsyncToken = ro.getReportList(rtpName);
			if( responder != null )
				asyncToken.addResponder(responder);
		}
		
		public function getReportDetailList(rtpId:String, responder:IResponder = null):void
		{
			var asyncToken:AsyncToken = ro.getReportDetailList(rtpId);
			if( responder != null )
				asyncToken.addResponder(responder);
		}
		
		
	}
}